package com.txx.myspringboot.ioc.ann;


import com.txx.myspringboot.ioc.Bean.Animal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

/**
 * 1.使用 @Component 向注入
 */
@Component
public class Hello2Service {

    @Autowired
    @Qualifier("monkey")
    private Animal animal;

    public String test(){
        return animal.getName();
    }
}
